<?php

class Producent_model extends Model
{
	function getall()
	{
		$res = $this->db->get('producent');
		return $res->result_array();
	}

	function create($data)
	{
		$this->db->insert('producent', $data);
		return $this->db->insert_id(); 
	}
	
	function read($prodID)
	{
		$res = $this->db->get_where('producent', array('prodID' => $prodID));
		return $res->row_array();
	}
	
	function update($prodID, $data)
	{
		$this->db->update('producent', $data, array('prodID' => $prodID));
		//echo '<pre>'; print_r($this->db->queries); echo '</pre>';
		//exit();
	}
	
	function delete($prodID)
	{
		$this->db->delete('producent', array('prodID' => $prodID));
	}
}